#!/bin/sh /etc/rc.common
# Copyright (C) 2018 prpl foundation

START=25
STOP=10
USE_PROCD=1

start_service()
{
	. /lib/functions.sh
	. /lib/functions/network.sh

	# 1905.1 protocol packets must not be bridged
	ebtables -t broute -A BROUTING -p 0x893a -j DROP

	procd_open_instance

	procd_set_param respawn ${respawn_threshold:-120} ${respawn_timeout:-5} ${respawn_retry:-5}

	# Log to logd
	procd_set_param stdout 1
	procd_set_param stderr 1

	procd_set_param command /usr/sbin/prplmesh

	# Uncomment this for verbose logging
	# procd_append_param command -v -v

	procd_close_instance
}

